<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<HEAD>
		<TITLE>
			詳細一覧
		</TITLE>
<script language="javascript" type="text/javascript">
function checkDate(typeName)
{
    var check = /^(19|20)[0-9]{2}$/;

	var y = document.getElementById("modifyDateY");
	var m = document.getElementById("modifyDateM").value;
	var d = document.getElementById("modifyDateD").value;	

        
        if (check.test(y.value) == false)
        {
            alert(typeName+"_年を入力不正");
            return false;
        }
        else
        {
            
            if(m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12)
            {
                if(d < 0 || d > 31)
                {
                    alert(typeName+"_日を選択不正");
                    return false;
                }
                else
                {
                    return true;
                }
            }
            else
            {
                if(m == 2)
                {
                    if(y % 400 == 0 || (y % 4 == 0 && y % 100 != 0))
                    {
                        if(d < 1 || d > 29)
                        {
                            alert(typeName+"_日を選択不正");
                            return false;
                        }
                        else
                        {
                            return true;
                        }
                    }
                    else
                    {
                        if(d < 1 || d > 28)
                        {
                            alert(typeName+"_日を選択不正");
                            return false;
                        }
                        else
                        {
                            return true;
                        }
                    }
                }
                else
                {
                    if(d < 1 || d > 30)
                    {
                        alert(typeName+"_日を選択不正");
                        return false;
                    }
                    else
                    {
                        return true;
                    }
                }
            }
        }

}

function formCheck(){

	var modifyDateY = document.getElementById("modifyDateY");
	var modifyDateM = document.getElementById("modifyDateM");
	var modifyDateD = document.getElementById("modifyDateD");	
    var status = document.getElementById("status");
    var modifypart = document.getElementById("modifypart");
    var modify = document.getElementById("modify");
    var reason = document.getElementById("reason");
	
	

		if(status.value==""){
			alert("ステータスを入力ください");
			return false;
		}else if(modifypart.value == ""){
			alert("修正担当側を選択ください");
			return false;
		}else if(modify.value==""){
			alert("修正担当を入力ください");
			return false;
		}else if(reason.value==""){
			alert("障害要因を選択ください");
			return false;
		}else if(!checkDate("修正日")) {
			return false;
	}

}
</script>
<style type="text/css">
	<!--
      fieldset {
        padding:10px;
        margin-top:5px;
        border:1px solid #A4CDF2;
        font-size:12px;
        }
     fieldset legend {
       font-weight:bold; 
       font-size: 15px; 
      }
      div_footer{
       text-align:center;
      }
     .select{
      width:110px;
      border-right: #000000 1px solid;
      border-top: #ffffff 1px solid;
      border-left: #ffffff 1px solid;
      color:#003366;
      border-bottom: #000000 1px solid;
      background-color: #f4f4f4;
      font-size:12px;
    }
     .select_m{
      border-right: #000000 1px solid;
      border-top: #ffffff 1px solid;
      border-left: #ffffff 1px solid;
      color:#003366;
      border-bottom: #000000 1px solid;
      background-color: #f4f4f4;
      font-size:12px;
    }
       .textarea{
        color:#003366;
        font-size:12px;
      }
    .btn1{
	   BORDER-RIGHT: #2C59AA 1px solid; 
	   PADDING-RIGHT: 2px; 
	   BORDER-TOP: #2C59AA 1px solid; 
	   PADDING-LEFT: 2px; 
	   FONT-SIZE: 12px; 
	   FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C3DAF5); 
	   BORDER-LEFT: #2C59AA 1px solid; 
	   CURSOR: hand; 
	   COLOR: black; 
	   PADDING-TOP: 2px; 
	   BORDER-BOTTOM: #2C59AA 1px solid;
	}
	 .textfield{
         width:40px;
         color:#003366; 
         font-size:12px;
      }
     -->
 </style>
 </HEAD>
<body text=#003366>
<s:form method="POST"  theme="simple">
<div id="viewEditArea">
<div id="contentArea">
<fieldset><legend>障害詳細</legend>

<table width=70% align=center>
	<tr>
		<td bgcolor=RGB(221,230,247)>
		<table width=100%>
			<tr bgcolor=RGB(221,230,247)>
				<td width=30% style="font-size:12px;">プロジェクト</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.project" /></td>
			</tr>
			<tr>
				<td width=30% style="font-size:12px;">所属テーマ</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.tema" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">テスト段階</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.test_lvl" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">検出側</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.test_part" /></td>
			</tr>
			<tr>
				<td width=30% style="font-size:12px;">検出者</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.tester" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">検出日</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.test_date" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">概要</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.memo" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">障害内容</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.error_text" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">対応期限</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.limit_date" /></td>
			</tr>
				<tr>
				<td width=30% style="font-size:12px;">備考</td>
				<td align="left" style="font-size:12px;"><s:property value="zhList.qa_memo" /></td>
			</tr>
		</table>
        </td>
    </tr>
</table>
</fieldset>
<fieldset><legend>障害対応</legend>
<s:hidden id="no" value=""></s:hidden>
	<table width=70% align=center>
	<tr>
		<td bgcolor=RGB(221,230,247)>
		<table width=100%>
			<tr>
				<td width=30% style="font-size:12px;">ステータス</td>
				<td align="left">
				<s:select id="status" label="ステータス" name="zhList.status" headerKey="" cssClass="select" headerValue="" list="statusArray" listKey="master_value" listValue="master_value" value="search.status" />
				</td>
			</tr>
			<tr>
				<td width=30% style="font-size:12px;">修正担当側</td>
				<td align="left">
				<s:select id="modifypart" label="修正担当側" name="zhList.modify_part" headerKey="" cssClass="select" headerValue="" list="modifypartArray" listKey="master_value" listValue="master_value" value="search.modify_part" />
				</td>
			</tr>
			<tr>
				<td width=30% style="font-size:12px;">修正担当</td>
				<td align="left">
				<s:select id="modify" label="修正担当" name="zhList.modify" headerKey="" cssClass="select" headerValue="" list="modifyArray" listKey="user_disp_value" listValue="user_disp_value" value="search.modify" />
				</td>
			</tr>
			<tr>
			    <td width=30% style="font-size:12px;">対応策</td>
				<td align="left"><textarea id="mehood" rows=10 cols=50 name="zhList.mehood" class="textarea"><s:property value="zhList.mehood" /></textarea>
				</td>
			</tr>
		    <tr>
				<td width=30% style="font-size:12px;">障害要因</td>
				<td align="left">
				<s:select id="reason" label="障害要因" name="zhList.reason" headerKey="" cssClass="select" headerValue="" list="reasonArray" listKey="master_value" listValue="master_value" value="search.reason" />
				</td>
			</tr>
			<tr>
			    <td width=30% style="font-size:12px;">原因</td>
				<td align="left"><textarea id="reasons" rows=10 cols=50 name="zhList.reasons" class="textarea"><s:property value="zhList.reasons" /></textarea>
				</td>
			</tr>
			<tr>
				<td width=30% style="font-size:12px;">修正日</td>
				<td align="left" style="font-size:12px;">
					<s:textfield id="modifydateY" name="zhList.modify_Date_Y" theme = "simple" size="2" maxlength="4" cssClass="textfield"/>年
					<s:select id="modifyDateM" name="zhList.modify_Date_M" headerKey="" headerValue="" cssClass="select_m" list="monthArray" value="zhList.modify_Date_M" theme = "simple"/>月
					<s:select id="modifyDateD" name="zhList.modify_Date_D" headerKey="" headerValue="" cssClass="select_m" list="dayArray" value="zhList.testStartDate_D" theme = "simple"/>日
				</td>			
			</tr>
		</table>
		</td>
	</tr>
	</table>
	<input type="hidden" id="no" name="zhList.no" value="<s:property value="no" />" />
</fieldset>
<table cellspacing="5" summary="隙間用">
  <tr><td></td></tr>
  <tr><td></td></tr>
  <tr><td></td></tr></table>
<table cellpadding="0" cellspacing="0" width="100%" bgcolor=RGB(238,242,251)>
 <tr>
   <td align = "center" width="20%"><s:submit btnId="D010" action="modifysg" value="確      認" theme="simple" onclick="return formCheck()" cssClass="btn1"/></td>
   <td align = "center" width="20%"><s:submit btnId="D011" value="キャンセル" theme="simple" onclick="javascript:window.close();" cssClass="btn1" /></td>
 </tr>
</table>
</div>
</div>
</s:form>
</body>
</html>
